<?php

class Default_NewsController extends Zend_Controller_Action
{
    const TINTUC = 1;
    
    public function init()
    {
        /* Initialize action controller here */
        $this->view->headTitle("News")->setSeparator(" | ");
    }

    public function indexAction()
    {
        // action body
    }
    
    
    public function newsDetailAction()
    {
        
        $idarticle = intval($this->_request->getParam("idarticle"));
        $mdArt = new Application_Model_DbTable_Article();
        $news = $mdArt->find($idarticle)->current();
        
        $news_release = $mdArt->fetchAll(
            $mdArt->select()->where("idarticles!=?",$news->idarticles)
                            ->where("categories_id=?",self::TINTUC)
                            ->order("article_date DESC")
                            ->limit(8)
        );
        $this->view->c_news = $news;
        $this->view->r_news = $news_release;
    }

}

